package com.xiaren.testforme;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;

import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction;

import com.xiaren.comm.DBHelp;
import com.xiaren.comm.Dao;

public class TestForDate {

	public static void main(String[] args) throws Exception {
		fordate();

	}

	static void fordate() throws SQLException {
		DBHelp dboracle = new DBHelp();
		Dao dao = new Dao();
		Connection conn = dboracle.getConnection(null,
				"jdbc:oracle:thin:@localhost:1521:ORCL", "test", "test");
		String sql = "select * from emp";
		List<Object[]> rs = dao.query(conn, sql);
		for (Object[] objects : rs) {
			for (Object object : objects) {
				if (object instanceof java.sql.Date) {
					java.sql.Date new_name = (java.sql.Date) object;
					System.out.println(new_name.getSeconds());
					System.out.println(new_name);
				}
			}
			System.out.println();
			break;
		}
		
		

	}

}
